﻿USE [GestionePolveri]
GO

/****** Object:  Table [GP].[Partite]    Script Date: 08/01/2013 22:44:57 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [GP].[Partite](
	[IDMovimento] [bigint] NOT NULL,
	[SPA1] [decimal](18, 0) NULL,
	[SPA2] [decimal](18, 0) NULL,
	[SPA3] [decimal](18, 0) NULL,
	[SPB1] [decimal](18, 0) NULL,
	[SPB2] [decimal](18, 0) NOT NULL,
	[SPB3] [decimal](18, 0) NULL,
	[FlagConforme] [bit] NOT NULL,
	[QuantitaVerniciata] [decimal](18, 0) NULL,
	[IDColore] [int] NULL,
 CONSTRAINT [PK_Partite_1] PRIMARY KEY CLUSTERED 
(
	[IDMovimento] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [GP].[Partite]  WITH CHECK ADD  CONSTRAINT [FK_Partite_AnagColori] FOREIGN KEY([IDColore])
REFERENCES [GP].[AnagColori] ([IDColore])
GO

ALTER TABLE [GP].[Partite] CHECK CONSTRAINT [FK_Partite_AnagColori]
GO

ALTER TABLE [GP].[Partite]  WITH CHECK ADD  CONSTRAINT [FK_Partite_Movimenti1] FOREIGN KEY([IDMovimento])
REFERENCES [GP].[Movimenti] ([IDMovimento])
GO

ALTER TABLE [GP].[Partite] CHECK CONSTRAINT [FK_Partite_Movimenti1]
GO

